package com.fh.shop.api.cate.controller;

import com.fh.shop.api.annotation.NeedLogin;
import com.fh.shop.api.cate.biz.ICateService;
import com.fh.shop.api.common.ServerResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/api/cates")
@Api(tags = "商品分类",description = "商品分类的前台API接口")
public class CateController {
    @Resource(name = "cateService")
    private ICateService cateService;

    @GetMapping
    @NeedLogin
    @ApiOperation("查询所有分类接口")
    @ApiImplicitParam(name = "x-auth",value = "自定义请求头接口",paramType = "header",required = true)
    public ServerResponse list(){
        return cateService.findList();
    }
}
